import { request } from "@/utils/service"
import type * as BuildType from "./types"

/** 增 */
export function createBuildTypeApi(data: BuildType.CreateOrUpdateBuildTypeRequestData) {
  return request({
    url: "buildType",
    method: "post",
    data
  })
}

/** 删 */
export function deleteBuildTypeApi(id: string) {
  return request({
    url: `buildType/${id}`,
    method: "delete"
  })
}

/** 改 */
export function updateBuildTypeApi(data: BuildType.CreateOrUpdateBuildTypeRequestData) {
  return request({
    url: "buildType/" + data.id,
    method: "put",
    data
  })
}

/** 查 */
export function getBuildTypeApi(params: BuildType.GetBuildTypeRequestData) {
  return request<BuildType.GetBuildTypeResponseData>({
    url: "buildType",
    method: "get",
    params
  })
}

/** 查详情 */
export function getBuildTypeDetailApi(id: string) {
  return request<BuildType.GetNewResponeseDetailData>({
    url: `buildType/${id}`,
    method: "get"
  })
}
